import Singleton from '../base/Singleton'
import { BurstMgr } from '../burst/BurstMgr'
import { DoorMgr } from '../door/DoorMgr'
import { IronSkeletonMgr } from '../ironSkeleton/IronSkeletonMgr'
import { ITile } from '../levels'
import { PlayerMgr } from '../player/PlayerMgr'
import { SmokeMgr } from '../smoke/SmokeMgr'
import { SpikesMgr } from '../spikes/SpikesMgr'
import { TileMgr } from '../tile/TileMgr'
import { WoodenSkeletonMgr } from '../woodenSkeleton/WoodenSkeletonMgr'
/** 中间层 存储相关数据 */
export default class DataMgr extends Singleton {
  static get Instance() {
    return super.getInstance<DataMgr>()
  }
  mapInfo: Array<Array<ITile>> = [] // 地图信息
  mapRowCount: number = 0 // 地图瓦片行数
  mapColumnCount: number = 0 // 地图瓦片列数
  level: number = 1 // 当前关卡
  tileInfo: Array<Array<TileMgr>> // 瓦片地图数据集合
  player: PlayerMgr // 玩家信息
  enemies: Array<WoodenSkeletonMgr | IronSkeletonMgr> // 敌人数组信息
  door: DoorMgr // 门信息
  bursts: Array<BurstMgr> = [] // 地裂陷阱集合
  spikes: Array<SpikesMgr> = [] // 地刺集合
  smokes: Array<SmokeMgr> = [] // 烟雾

  reset() {
    this.mapInfo = []
    this.tileInfo = []
    this.player = null
    this.enemies = []
    this.bursts = []
    this.spikes = []
    this.smokes = []
    this.door = null
    this.mapRowCount = 0
    this.mapColumnCount = 0
  }
}
